package com.jt.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.jt.interceptor.ManagerInterceptor;

/**
 * @author dc
 */
@Configuration    //表示原始的mvc配置文件
public class InterceptorConfigurer implements WebMvcConfigurer{
	
	
	@Autowired
	private ManagerInterceptor managerInterceptor;
	/**
	 * 添加拦截器配置
	 * /cart/** 所有的路径        /cart/* 一级目录
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		//添加拦截器对象
		registry.addInterceptor(managerInterceptor)
				//只拦截manage.jt.com
				.addPathPatterns("/","/page/**");
	}
}
